<template>
  <div class="mininav">
    <div class="topNav">
      <top-nav />
    </div>
    <div class="nav">
      <div class="left">
        <img :src="logo" alt="" style="cursor: pointer" />
      </div>
      <div class="container">
        <router-link class="tab-item" :to="{ name: 'CompanyHomeHome'}">企业主页</router-link>
        <router-link class="tab-item" :to="{ name: 'CompanyHomeProduct'}">公司产品</router-link>
        <router-link class="tab-item" :to="{ name: 'CompanyHomeIntro'}">公司介绍</router-link>
        <router-link class="tab-item" :to="{ name: 'CompanyHomeCertifi'}">PackMate认证</router-link>
        <router-link class="tab-item" :to="{ name: 'CompanyHomeNews' }">公司新闻</router-link>
        <router-link class="tab-item" :to="{ name: 'CompanyHomeConnect'}">联系方式</router-link>
        <router-link class="tab-item" :to="{ name: 'CompanyHomeProblem'}">常见问题</router-link>
      </div>
    </div>
  </div>
</template>

<script>
import MSearchbar from "@/components/m-searchbar/MSearchbar";
import TopNav from "./TopNav";

export default {
  name: "MiniNav",
  components: { MSearchbar, TopNav },
  props: {
    logo: {
      type: String,
    }
  },
  data() {
    return {
      keywords: null
    }
  },
  methods: {
    search() {
      if (this.keywords) {
        this.$router.push({
          name: "CompanyHomeProduct",
          query: {
            keyword: this.keywords,
            t: Date.now()
            }
        })
      }
    }
  }
}
</script>

<style scoped>
.mininav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  background: #fff;
  width: 100%;
}
.nav {
  width: 1200px;
  min-height: 155px;
  font-size: 14px;
  color: #fff;
  margin: 0 auto;
  position: relative;
}
.nav .container {
  position: absolute;
  line-height: 55px;
  right: 0;
  bottom: 20px;
  background: #e38b2e;
  display: flex;
  width: 900px;
}
.nav .container .tab-item {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.nav .container .tab-item:hover {
  color: #e38b2e;
  background: #fcd4a0;
}
.container .router-link-active {
  color: #e38b2e;
  background: #fcd4a0;
}
.nav .container .tab-item::after {
  content: "";
  width: 1px;
  height: 32px;
  background: #fff;
  position: absolute;
  right: 0;
  top: 16px;
  opacity: 0.4;
}
.nav .container .tab-item:last-of-type::after {
  display: none;
}
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}

.nav .left {
  position: absolute;
  left: 0;
  bottom: 15px;
}

.nav .left img {
  width: 234px;
  height: 100px;
  object-fit: cover;
  position: relative;
}

.right {
  margin-top: 20px;
  float: right;
  width: 200px;
  height: 60px;
}

.icon {
  display: flex;
}

.icon a {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  align-items: center;
}

.icon a {
  color: #000;
}

.icon a.active {
  color: #e38b2e;
}

.icon a:hover {
  color: #e38b2e;
}

.icon a img {
  width: 20px;
  height: 23px;
  margin-bottom: 6px;
}
.search-bar {
  margin-left: 30px;
}
</style>
